package tj.warning.pull.controller;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
import tj.warning.pull.mapper.report1.Report1Mapper;
import tj.warning.pull.mapper.report2.Report2Mapper;
import tj.warning.pull.mapper.report3.Report3Mapper;
import tj.warning.pull.service.BizService;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.io.IOException;
import java.util.*;
import java.util.stream.Collectors;

@RestController
public class Test {
    @Value("${biz.tj.appKey}")
    private String appKey;

    @Value("${biz.tj.appSecret}")
    private String appSecret;

    @Value("${biz.tj.url1}")
    private String url1;

    @Value("${biz.tj.url2}")
    private String url2;
    @Resource
    private RestTemplate restTemplate;

    public static void main(String[] args) {
        List<Integer> list=new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            list.add(i);
        }
        int count=(list.size()+2)/3;
        for (int i = 0; i < count; i++) {
            if(i==count-1){
                System.out.println("list = " + list.subList(i*3,list.size()));
                return;
            }
            System.out.println("list = " + list.subList(i*3,(i+1)*3));
        }
    }
}
